package com.example.admin.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.admin.R;

public class AdminHomeAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    int poin = -1;

    public void setPoin(int poin) {
        this.poin = poin;
        notifyDataSetChanged();
    }

    public AdminHomeAdapter() {
        super(R.layout.item_admin_home);
    }

    @Override
    protected void convert(BaseViewHolder helper, String str) {
        helper.setText(R.id.tvTitle, str);
        helper.setTextColor(R.id.tvTitle, helper.getLayoutPosition() == poin ? Color.BLACK : Color.GRAY);
    }

}